|
HSL 2.0 framework
Description of the framework
|
All methods of the interval object. More
..Public Member Functions | |
| def | __init__ (self, framework) |
| Constructor. More... | |
| def | set_interval (self, time, callback, arguments=()) |
| Sets the interval time and the callback method to be called after the interval timer starts. More... | |
| def | stop (self) |
| Stops the interval timer. More... | |
| def | start (self) |
| Starts the interval timer. More... | |
All methods of the interval object
An example for the implementation of an interval timer is enclosed: 10709_MyIntervaltimer.py
If a 1 is sent to input 1, an interval timer is generated and started, which triggers at an interval whose length (in seconds) is determined by input 2 and writes an output with the value '1'
The timer can be stopped by sending a '0' to input 1
| def hsl20_4_timer.hsl20_4_timer.Interval.__init__ | ( | self, | |
| framework | |||
| ) |
Constructor
| def hsl20_4_timer.hsl20_4_timer.interval.set_interval | ( | self, | |
| time, | |||
| callback, | |||
arguments = () |
|||
| ) |
Sets the interval time and the callback method to be called after the interval timer has started
| time | int Time in ms |
| callback | After time has expired, the callback method is called |
| arguments | tuple Optional. The elements of the tuple are passed as parameters to the callback method when called |
| RuntimeError | If this method is called while the interval timer is already running, a RuntimeError exception is thrown |
| def hsl20_4_timer.hsl20_4_timer.interval.start | ( | self | ) |
Starts the interval timer
The callback is called for the first time after the time defined in the set_interval method
| AttributeError | Is triggered if no callback or timeout has been defined |
| def hsl20_4_timer.hsl20_4_timer.interval.stop | ( | self | ) |
Stops the interval timer
1.8.13